# -*- mode: snippet -*-
# name: frequency/contingency table in dplyr
# key: dplyr.frequency.contingency
# --
  group_by(${1:group}, ${2:factor}) |>
  summarise(n = n()) |>
  mutate(N = sum(n),
         p = n / N)
